#include<bits/stdc++.h>
using namespace std;
int n,sum1,sum2;
int r[100005];
bool flag=true;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>r[i];
        if(r[i]==1) sum1++;
        if(r[i]==2) sum2++;
        if(r[i]>2){
            flag=false;
        }
    }
    if(!flag){
        cout<<1;
    }else{
        cout<<n-sum2;
    }
    fclose(stdin);
    fclose(stdout);
    return 0;
}
